package com.puff.plugin.spring;

import java.util.Properties;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.puff.plugin.Plugin;

public class SpringPlugin implements Plugin {
	private Properties prop;

	@Override
	public void init(Properties prop) {
		this.prop = prop;
	}

	@Override
	public boolean start() {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(prop.getProperty("config", "spring.xml"));
		BeanContextHelper.INSTANCE.setContext(context);
		return true;
	}

	@Override
	public boolean stop() {
		return true;
	}

}
